<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('修改免疫记录')" />
	<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-ncMianyiLogs-edit" th:object="${ncMianyiLogs}">
		<input id="myId" name="myId" th:field="*{myId}"  type="hidden">
		<div class="form-group" hidden="hidden">
			<label class="col-sm-3 control-label">免疫类型 ：</label>
			<div class="col-sm-8">
				<input id="myType" name="myType" th:field="*{myType}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group"  hidden="hidden">
			<label class="col-sm-3 control-label">状态：</label>
			<div class="col-sm-8">
				<input id="myStatus" name="myStatus" th:field="*{myStatus}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">圈舍号：</label>
			<div class="col-sm-8">
				<select name="roomNum" class="form-control m-b" th:with="type=${@dict.getType('chicken_juanshe_num')}">
					<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{roomNum}"></option>
				</select>
			</div>
		</div>
		<div class="form-group" hidden="hidden">
			<label class="col-sm-3 control-label">订单id：</label>
			<div class="col-sm-8">
				<input id="orderId" name="orderId" th:field="*{orderId}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">存栏数量：</label>
			<div class="col-sm-8">
				<input id="stockAmount" name="stockAmount" th:field="*{stockAmount}" class="form-control" type="number">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">免疫数量：</label>
			<div class="col-sm-8">
				<input id="myAmount" name="myAmount" th:field="*{myAmount}" class="form-control" type="number">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">疫苗名称：</label>
			<div class="col-sm-8">
				<input id="ymName" name="ymName" th:field="*{ymName}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">疫苗生产厂家：</label>
			<div class="col-sm-8">
				<input id="ymFactory" name="ymFactory" th:field="*{ymFactory}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">批号（有效期）：</label>
			<div class="col-sm-8">
				<input id="ymCode" data-type="datetime" data-format="yyyy-MM-dd" name="ymCode" required
					   th:value="*{#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd')}" class="form-control"
					   type="text" th:class="time-input">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">用药方法：</label>
			<div class="col-sm-8">
				<select name="myWays" class="form-control m-b" th:with="type=${@dict.getType('animalExecuteType')}">
					<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">免疫剂量：</label>
			<div class="col-sm-8">
				<input id="myDose" name="myDose" th:field="*{myDose}" class="form-control" type="number" min="0">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">免疫操作员：</label>
			<div class="col-sm-8">
				<select id="createBy" name="createBy" class="form-control select2-multiple" >
					<option th:each="user:${users}" th:value="${user.loginName}" th:text="${user.loginName}" th:field="*{createBy}" ></option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">检测时间：</label>
			<div class="col-sm-8">
				<input id="createTime" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" name="createTime" required
					   th:value="*{#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd hh:mm:ss')}" class="form-control"
					   type="text" th:class="time-input">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">备注：</label>
			<div class="col-sm-8">
				<textarea rows="4" name="remark" th:field="*{remark}" class="form-control" type="text"></textarea>
			</div>
		</div>
	</form>
</div>
<div th:include="include::footer"></div>
<th:block th:include="include :: select2-js" />
<script type="text/javascript">
	var prefix = ctx + "system/ncMianyiLogs/chicken";
	$("#form-ncMianyiLogs-edit").validate({
        rules: {
            myAmount: {
                required: true,
                digits: true
            },
            stockAmount: {
                required: true,
                digits: true
            },
            myDose: {
                required: true,
                digits: true
            }
        },
        messages: {
            stockAmount: "存栏数必须为正整数",
            myAmount: "免疫数必须为正整数",
            myDose: "剂量数必须为正整数"
        },
        focusCleanup: true
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/edit", $('#form-ncMianyiLogs-edit').serialize());
		}
	}
</script>
</body>
</html>
